﻿
using System.Collections.Generic;
using System.Security.Policy;

namespace DataAccess.Entities
{
    public class Media
    {
        public virtual int Id { get; set; }
        public virtual string Title { get; set; }
        public virtual string Description { get; set; }
        public virtual Account Owner { get; set; }
        public virtual Url Url { get; set; }
        public virtual IList<Interest> Categories { get; set; } 
        public virtual IList<Account> Tags { get; set; }
        public virtual IList<Comment> Comments { get; set; } 

        public Media()
        {
            Categories = new List<Interest>();
            Tags = new List<Account>();
            Comments = new List<Comment>();
        }

        public virtual void AddCategory(Interest category)
        {
            Categories.Add(category);
        }

        public virtual void AddTag(Account account)
        {
            account.MediaTaggedIn.Add(this);
            Tags.Add(account);
        }

        public virtual void AddComment(Comment comment)
        {
            comment.Owner = Owner;
            Comments.Add(comment);
        }
    }
}
